<template>
    <view class="login-wrap">
        <view class="login-bg">
            <view class="mask"></view>
            <view class="text-wrap">
                <view class="title1">杭州大会展中心</view>
                <view class="title2">一体化运营</view>
                <view class="text">
                    <text>设备智联</text>
                    <text>全息时空</text>
                    <text>数据融合</text>
                    <text>智慧运营</text>
                </view>
            </view>
        </view>
        <view class="my-form">
            <view class="flex">
                <text>账号</text>
                <input v-model="formData.username" type="text" placeholder="请输入用户名" />
            </view>
            <view class="flex">
                <text>密码</text>
                <input v-model="formData.password" placeholder="请输入密码" />
            </view>
            <button class="login-btn" type="primary" @click="submitForm">登 录</button>
        </view>
        <view class="text1">未注册用户请联系管理员创建账号</view>
    </view>
</template>

<script lang="ts" setup name="login">
import { reactive } from 'vue';
// import { useAuthStore } from '@/state/modules/auth';
// import { useRouter } from 'uni-mini-router';

// const router = useRouter();
// const authStore = useAuthStore();
const formData = reactive({
    username: 'admin',
    password: '123456',
});

const submitForm = () => {
    // authStore.token = 'test@66668888';
    // router.push({
    //     name: 'Home',
    // });

    uni.switchTab({ url: '/pages/home/index' });
};
</script>

<style lang="scss" scoped>
.login-wrap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
}

.login-bg {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 500rpx;
    background-image: url('@/static/images/login/bg.png');

    .mask {
        position: absolute;
        width: 100%;
        height: 100%;
        background: linear-gradient(180deg, rgb(0 18 36 / 0%) 0%, #001224 100%);
    }

    .text-wrap {
        position: absolute;
        z-index: 1;
        padding-left: 32rpx;
        width: 100%;
        height: 100%;
    }

    .title1 {
        margin-top: 412rpx;
        font-size: 32px;
        line-height: 46px;
        color: #fff;
    }

    .title2 {
        font-size: 32px;
        line-height: 46px;
        color: #fff;
    }

    .text {
        display: flex;
        margin-top: 32rpx;
        font-size: 24rpx;
        color: #fff;
        line-height: 32rpx;
        column-gap: 32rpx;
    }
}

.text1 {
    padding: 32rpx;
    font-size: 24rpx;
    text-align: center;
    color: #6c6c6c;
}

.my-form {
    padding-top: 48rpx;

    .flex {
        justify-content: center;
        align-items: center;
        margin: 32rpx;
        height: 112rpx;
        font-size: 38rpx;
        border-bottom: 1rpx solid #ddd;
        color: #131414;

        input {
            padding-left: 32rpx;
            height: 56px;
            font-size: 32rpx;
            color: #131414;
            flex: 1;
            line-height: 36px;
        }
    }

    .login-btn {
        width: 50%;
    }

    button {
        margin-top: 100rpx;
    }
}
</style>
